package com.qvtu.springboot.mapper;

import com.qvtu.springboot.entity.Department;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DepartmentMapper {
    @Insert("insert into `department`(name) values(#{name})")
    void insert(Department department);

    @Delete("delete from `department` where id=#{id}")
    void deleteById(Integer id);

    @Update("update `department` set name=#{name} where id=#{id}")
    void update(Department department);

    @Select("select * from `department` where id=#{id}")
    Department selectById(Integer id);

     List<Department> selectAll(Department department);
}